class Animal:
    name = "animal"

    def shout(self):
        print("animal shout")


class Dog(Animal):
    name = "dog"

    def eat(self):
        print("dog eat")

    @classmethod
    def set_name(cls, new_name):
        cls.name = new_name


dog1 = Dog()
print(dog1.name)  # 输出: dog
print(Dog.name)  # 输出: dog

Dog.set_name("_dd")
print(Dog.name)  # 输出: _dd
print(dog1.name)  # 输出: _dd

dog2 = Dog()
print(dog2.name)  # 输出: _dd